/* AUTHOR OF MAIN.c -> KILLIAN MURPHY */

#include "LINEFOLLOW.h"
#include "debug_frmwrk.h"
#include "wall_follow.h"
#include "SERIALAPI.h"
#include "prox_sensors.h"
#include "LINE_SEARCH.h"
#include <stdlib.h>
#include <stdio.h>
#include "mouse_sensor.h"
#include "move_hack.h"

void main(void) {
  /* TASK 1 - LEFT SIDE */

  /* // debug_frmwrk_init();
  SERIAL_INIT();
  // _DBG_("DYNAMIC ENTRY!");
  init_wall_follow(23);
  int32_t ticker = 1000000;
  while(ticker--) {
    evaluate_step(-1, 0);
    M1_FORWARD(get_m1());
    M2_FORWARD(get_m2());
    } */
  
  /* TASK 1 - RIGHT SIDE */
  /*
  //debug_frmwrk_init();
  SERIAL_INIT();
  init_wall_follow(23);
  int32_t ticker = 1000000;
  while(ticker-- &&) {
    evaluate_step(1, 0);
    M1_FORWARD(get_m1());
    M2_FORWARD(get_m2());
  }*/
  
  /* PERSONAL PROJECT */
  /*  uint32_t tick = 57600000;
  SERIAL_INIT();
  LINE_AutoCalibrate();;
  M1_FORWARD(0x20);
  M2_FORWARD(0x20);
  while(tick--);
  STOP_MOTORS();
  //  LINE_Spiral_Search(CLKW); */

  // TASK 2 IS INCORPORATED IN TASK 1 CODE - SEE wall_follow.c
  // AND wall_follow.h

  /* TASK 3 */
  /*  SERIAL_INIT();
  ENCODERS_INIT();
  MOUSE_INIT();
  MOVE_FORWARD(2);
  ROTATE(90, CLKW);
  MOVE_FORWARD(1);
  ROTATE(45, CCLKW); */

  /* TASK 4 */
  uint8_t WFOLLOWING = 0;
  uint8_t LFOLLOWING = 0;
  uint8_t TRAVERSING = 0;
  uint8_t STOPPED = 1;

  SERIAL_INIT();
  init_wall_follow(23);
  init_mouse_sensors();
}
